/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: jingziyou
 * Date: 2023-05-17
 * Time: 19:40
 */
public class Test {
    public static void main(String[] args) {
        Animal an1 = new Cat();
        Animal an2 = new Dog();
        if(an1 instanceof Cat){
            Cat c = (Cat)an1;
            c.eatFish();
        }
        if(an2 instanceof Dog){
        Dog d =(Dog)an2;
        d.eatBond();
        }
    }
}
